package common.interfaces;

import msg.EventMessage;
import msg.Message;

/**
 * A message visitor
 * 
 * @author Gal Lalouche
 * @param <T> The return type of the visit
 */
public interface IMessageVisitor<T> {

	/**
	 * Visit a message
	 * 
	 * @param message The message to visit
	 * @return An object of type T
	 * @throws Exception
	 */
	T visit(Message message) throws Exception;

	/**
	 * Visit an event
	 * 
	 * @param event The event to visit
	 * @return An object of type T
	 * @throws Exception
	 */
	T visit(EventMessage event) throws Exception;

}
